<!doctype html>
<html class="no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="description" content="">
	<meta name="keywords" content="">
	<!-- <meta name="viewport" content="width=device-width, initial-scale=0">
	<meta name="viewport" content="width=drvice-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;"> -->
	<meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1">
	<title>手机微信版一元夺宝商城网</title>

	<link rel="icon" type="image/png" href="../qgj_qt/images/favicon.png">

	<link rel="stylesheet" href="./css/amazeui.min.css">
	<link rel="stylesheet" href="./css/swiper.min.css">
	<link rel="stylesheet" href="./css/app.css">
	<!-- jquery -->

    <script src="layui/layui.js"></script>
    <script src="./static/js/jquery.js"></script>
    <!--
	<script src="./js/jquery.min.js"></script>
	<script src="./js/swiper.min.js"></script> -->

</head>

<body>

<!-- 外框 -->
<div id="waik">
<!-- 头部 -->
<div id="top" style="background:#D91D37;" class="ziye_top">
    <div class="sos_t sos_t_zy ">
        <div class="fanh_shang fanh_yems">
            <a href="javascript:;" onclick="history.back();"><img src="images/jiant1.png"></a>
        </div>
        <div class="text">登录</div>
        <div class="right">
            <div class="zd"><a href="#">客服</a></div>
        </div>
    </div>
</div>
<!-- 明细 -->
<div class="zy_login_box_sign">
    <div class="login_box ">
        <div class="zhuce_con">
            <div class="zhuce_tel sign_qieh">
                <form action="se_login" method="post">
                    @csrf
                    <div>
                        <label><a><img src="./images/zy_icon_user.png"></a>
                            <input type="text" id="username" name="username" placeholder="用户名/手机号">
                        </label>
                    </div>
                    <div>
                        <label class="ms sign_ms" >
                            <a><img src="./images/zy_icon_mm.png"></a>
                            <input type="password" id="password" name="password" placeholder="请输入密码">
                            <div class="no_ms">
                                <img src="./images/yanj_b.png">
                                <i>丨</i>
                                <a class="ni" href="#">忘记密码</a>
                            </div>
                        </label>
                    </div>
                    <div class="yzm">
                            <label>
                            <input type="text" id="" name="daunx" placeholder="用户名/手机号">
                            <div class="no_ms">
                            <a href="">获取短信</a>
                            </div>
                        </label>
                    </div>
                    <button class="denglu"  id="submit" style="margin-left:70px;height: 30px;width: 200px;">登 录</button>
                </form>
                <!--  -->
            </div>
        </div>
    </div>
    <div class="yanz" id="yanz_qh">
        <a href="javascript:;" is_queh="yes">短信验证登录</a>
        <a href="register" class="no">新用户注册</a>
    </div>
</div>
<script>
    // 切换登录方式
    $(function(){
        $("#yanz_qh > a:first").mousedown(function(){
            var is_queh= $(this).attr('is_queh');
            if(is_queh=="yes"){
                $(this).attr('is_queh',"no");
                $(".sign_qieh form:first").hide();
                $(".sign_qieh form:last").show();
                $("#yanz_qh > a:first").text("账号登录");
            }else{
                $(this).attr('is_queh',"yes");
                $(".sign_qieh form:first").show();
                $(".sign_qieh form:last").hide();
                $("#yanz_qh > a:first").text("短信验证登录");
            }
        });
    });
    // 密码
    // $(function(){
    //     $(".sign_ms .no_ms img").mousedown(function(){
    //         $(".sign_ms input").attr("type","text");
    //     });
    //     $(".sign_ms .no_ms img").mouseup(function(){
    //         $(".sign_ms input").attr("type","password");
    //     });
    // });
    $(function(){
        $(".sign_ms .no_ms img").on("mouseover",function(){
            $(".sign_ms input").prop("type","text");
        });
        $(".sign_ms .no_ms img").on("mouseout",function(){
            $(".sign_ms input").prop("type","password");
        });
    });
</script>
<!-- 底部 -->
<div class="my_yve_footer">
    <a class="#">登录时即代表您已经同意<em>《广告之家服务政策》</em></a>
</div>

<!-- 外框结束div -->
</div>

<script>
// 首页
 // 搜索显示隐藏
$(function(){
	$("#input1").mousedown(
		function(){
			$(".search_bomb_box").show()
			$("#waik").hide()
		}
	)
	$(".search_bomb_box .search_top>a").mousedown(
		function(){
			$(".search_bomb_box").hide()
			$("#waik").show()
		}
	)
})

/*获取验证码*/
var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;//手机号正则
var count = 60; //间隔函数，1秒执行
var InterValObj1; //timer变量，控制时间
var curCount1;//当前剩余秒数
/*第一*/
function sendMessage1() {
    curCount1 = count;
    var phone = $.trim($('#phone1').val());
    if (!phoneReg.test(phone)) {
        alert(" 请输入有效的手机号码");
        return false;
    }
    //设置button效果，开始计时
    $("#btnSendCode1").attr("disabled", "true");
    $("#btnSendCode1").val( + curCount1 + "秒再获取");
    InterValObj1 = window.setInterval(SetRemainTime1, 1000); //启动计时器，1秒执行一次
    //向后台发送处理数据

}
function SetRemainTime1() {
    if (curCount1 == 0) {
        window.clearInterval(InterValObj1);//停止计时器
        $("#btnSendCode1").removeAttr("disabled");//启用按钮
        $("#btnSendCode1").val("重新发送");
    }
    else {
        curCount1--;
        $("#btnSendCode1").val( + curCount1 + "秒再获取");
    }
}

/*提交*/
function binding(){
    alert(1)
}

</script>

<script>

        $('#submit').click(function () {
            $.get({
                url:"se_login",
                data:'username='+$('#username').val()+'&password='+$('#password').val(),
                success:function (data) {
                    layui.use('layer', function(){
                        var layer = layui.layer;
                        if(data.code=='1') {
                            layer.open({
                                title: '登录成功'
                                , skin: 'msg'
                                , content: data.name
                                , yes: function () {
                                    location.href = data.url;
                                }
                            });
                        }else if(data.code=='-1'){
                            layer.open({
                                title: '登录失败'
                                , skin: 'msg'
                                , content: data.name
                                , yes: function () {
                                    location.href = '/denglu';
                                }
                            });
                        }else {
                            layer.open({
                                title: '登录失败'
                                , skin: 'msg'
                                , content: data.name
                                , yes: function () {
                                    location.href = '/denglu';
                                }
                            });
                        }
                    });
                }
            });
            return false;
        });

</script>
